package principle.singleResponsibility;

/**
 * @author lcy
 * @date 2024/7/12 17:12
 */
public class Responsibility1 {
    public static void main(String[] args) {
        Vehicle vehicle = new Vehicle();
        vehicle.run("汽车");
        vehicle.run("火车");
        vehicle.run("飞机");
        vehicle.run("轮船");
    }
}

/*
 *  明显飞机和轮船不应该在公路上跑，违背了单一职责原则
 */

class Vehicle{

    public void run(String vehicle){
        System.out.println(vehicle + "在地上跑");
    }
}
